﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Text;

namespace EmProductCenter.dpxf
{
    public partial class cjwt : System.Web.UI.Page
    {
        readonly LYM.CommonWeb.DataServer.DataBase data = new LYM.CommonWeb.DataServer.DataBase(LYM.CommonWeb.ConfigHelper.GetConfigString("EMPC"), false);
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {

            }
        }

        protected void btn_Submit_Click(object sender, EventArgs e)
        {
            int count = 0;
            data.ProExecuteCommand("update ePioneer_Lecturer set Location='" + txt_Location.Text.Trim() + "' where Id='3'", false,ref count, null);
            Cache.Remove("ePioneer_Lecturer");
        }

        protected void btn_Query_Click(object sender, EventArgs e)
        {
            DataTable dt = new DataTable();
            if (Cache["ePioneer_Lecturer"] == null)
            {
                data.GetDataTable("select * from ePioneer_Lecturer", false,ref dt, null);
                Cache.Insert("ePioneer_Lecturer", dt);
            }
            else
            {
                dt = Cache["ePioneer_Lecturer"] as DataTable;
            }
            StringBuilder str = new StringBuilder();
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                str.AppendLine(dt.Rows[i]["Location"].ToString());
            }
            lab_Location.Text = str.ToString();
        }
    }
}